Update gtk/gtkmenuitem.c...
authorChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 15 Apr 2011 16:42:08 +0000 (00:42 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 15 Apr 2011 16:42:08 +0000 (00:42 +0800)
Copy over the implementation of _gtk_menu_shell_activate
so that C4013 warning/error (aka gcc's "implicit
declaration of ...") can be avoided when compiling with MSVC

This is in response of the changes for bug 554057 in commit
5f55c420471db9a05d145e140b3a7cdfc5bdba9f

gtk/gtkmenuitem.c

index 72fbe4227bcff7ab5a0ff7adbff6ddf15104038c..ccd12838c3dc2fe503618bd51b2e8f449b3bc49a 100644 (file)
@@ -168,6 +168,24 @@ G_DEFINE_TYPE_WITH_CODE (GtkMenuItem, gtk_menu_item, GTK_TYPE_BIN,
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE,
                                                 gtk_menu_item_activatable_interface_init))
 
+static void
+_gtk_menu_shell_activate (GtkMenuShell *menu_shell)
+{
+  GtkMenuShellPrivate *priv = menu_shell->priv;
+
+  if (!priv->active)
+    {
+      GdkDevice *device;
+
+      device = gtk_get_current_event_device ();
+
+      _gtk_menu_shell_set_grab_device (menu_shell, device);
+      gtk_device_grab_add (GTK_WIDGET (menu_shell), device, TRUE);
+
+      priv->have_grab = TRUE;
+      priv->active = TRUE;
+    }
+}
 
 static void
 gtk_menu_item_class_init (GtkMenuItemClass *klass)